package org.mii.safeguard_v1.base.entity;

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "ct_network")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CtNetwork extends IdEntity {
	private String name;
	private String desc;
	private Set<CtNetworkA> ctNetworkAs = new LinkedHashSet<CtNetworkA>();

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	@OneToMany(mappedBy = "ctNetwork", cascade = { CascadeType.PERSIST,
			CascadeType.MERGE, CascadeType.REMOVE }, fetch = FetchType.LAZY)
	public Set<CtNetworkA> getCtNetworkAs() {
		return ctNetworkAs;
	}

	public void setCtNetworkAs(Set<CtNetworkA> ctNetworkAs) {
		this.ctNetworkAs = ctNetworkAs;
	}
}
